#!/usr/bin/env pybricks-micropython

import sys
sys.path.append("..")

import player

def play():
    # Twinkle Twinkle Little Star
    beep_sequence = [
        # 第一组: -f 262 -l 180 -d 20 -r 2
        (262, 180),
        20,
        (262, 180),
        20,
        # -n -f 392 -l 180 -d 20 -r 2
        (392, 180),
        20,
        (392, 180),
        20,
        # -n -f 440 -l 180 -d 20 -r 2
        (440, 180),
        20,
        (440, 180),
        20,
        # -n -f 392 -l 380 -d 20
        (392, 380),
        20,
        # -n -f 349 -l 180 -d 20 -r 2
        (349, 180),
        20,
        (349, 180),
        20,
        # -n -f 330 -l 180 -d 20 -r 2
        (330, 180),
        20,
        (330, 180),
        20,
        # -n -f 294 -l 180 -d 20 -r 2
        (294, 180),
        20,
        (294, 180),
        20,
        # -n -f 262 -l 400
        (262, 400),
    ]
    player.play(beep_sequence)

if (__name__ == "__main__"):
    print("Playing Twinkle Twinkle Little Star ...")
    play()
